The present invention generally relates to reporting an attribute value of a device over a PS/2 communication channel, and more specifically, pertains to reporting the attribute value of the device using PS/2 communication protocols and an industry standard PS/2 port driver that do not include provisions for explicitly recognizing the attribute or its value.
The PS/2 communication protocol remains in wide use, especially for interfacing a keyboard and pointing device to a host computing device. Although the PS/2 communication protocol has many limitations, components conforming to the PS/2 protocol are relatively inexpensive and widely available. The requirements for PS/2 data packets that conform to this protocol for such devices are relatively simple and well known. Thus, the PS/2 protocol remains attractive for use in communicating with low cost devices, such as personal computer keyboards and pointing devices, that are connected to the PS/2 port of a computing device.
However, use of the standard PS/2 protocol has been extended somewhat to accommodate a few additional device features that were not originally contemplated in the protocol. For example, a scroll wheel on a mouse is accommodated by using the following 4-byte data packet rather than a conventional 3-byte data packet used for a mouse that does not include a scroll wheel. Clearly, specific drivers must be used with a mouse that includes a scroll wheel to support this added functionality.
The fourth byte comprises a 2""s complement number that represents the scrolling wheel""s movement since a last data report. A scroll wheel is sometimes referred to as a Z wheel, and scroll wheel movement is sometimes referred to as Z movement. Valid values of Z movement are in the range of xe2x88x928 to +7 (decimal). Because the values are relatively low, the Z movement number is actually represented only by the least significant 4 bits of the 4th byte. The most significant 4 bits act only as sign extension bits.
PS/2 port drivers were developed with considerable effort and expense to accommodate the above 4-byte data packet for scroll wheel movement. These PS/2 port drivers are now well known and widely available, constituting an industry standard. However, further extension of these port drivers to accommodate still more features is undesirable, because the PS/2 protocol is being replaced by more flexible alternative protocols, such as the universal serial bus (USB) protocol, designed for other types of communication ports on a computing device. Nevertheless, the PS/2 protocol is likely to remain in use for a number of years, and additional features for electronic devices that use the protocol are certain to emerge. Thus, while it is desirable to continue using current PS/2 drivers and components, an approach is required to accommodate new features within the constraints of the PS/2 protocol.
For example, many newer PS/2 keyboards, mice, and other devices use wireless technology that frees the devices from direct connection with a host device. Although wireless devices provide greater freedom of movement, the wireless feature introduces other problems. For instance, wireless devices do not obtain power from the host device. Instead, the wireless devices typically include batteries to provide their own power. Similarly, wireless devices are more susceptible to electromagnetic interference than a wired device that is connected directly to the host device. Such problems create a need to monitor the wireless devices to determine parameters such as battery level and signal quality. Unfortunately, the PS/2 protocol and currently widely used industry standard port drivers do not support reporting such monitoring functions to the host. Although the port drivers could be rewritten to support monitoring functions or other features, rewriting the port drivers is undesirable, because of the required effort and expense, and because of the uncertain future of PS/2 ports on newer computing devices. Thus, an alternative approach is desired that enables use of the existing PS/2 infrastructure of drivers and components, yet accommodates monitoring and conveying information in regard to additional features of new devices that communicate using the PS/2 protocol.
The present invention provides a method and system for reporting a value of a device attribute to a host, wherein the device attribute is not explicitly recognized by the PS/2 communication protocol. The method and system also do not require modification of the PS/2 communication protocol or of an industry standard PS/2 port driver through which the device attribute is conveyed. Instead, the present invention involves encoding the device attribute value in a conventional PS/2 data packet, and identifying this encoded data packet with predefined device data that is highly unlikely to occur with regular use of the device. More specifically, a set of predefined device data comprises a predefined indicator and are provided in one portion of the encoded data packet that is allocated for conveying at least a first standard parameter that is explicitly recognized in the PS/2 protocol. The device attribute value is encoded in another portion of the encoded data packet that is allocated for at least a second standard parameter that is explicitly recognized in the PS/2 protocol. The encoded data packet is communicated to the host through a standard PS/2 port that is controlled by the industry standard PS/2 port driver. Preferably, the host executes a filter driver that evaluates each PS/2 packet received by the PS/2 port driver, and recognizes an encoded data packet by the predefined device data that comprises the predefined indicator. Once an encoded data packet is detected, the device attribute value is decoded from the encoded data packet. The host may then use the device attribute for any purpose.
The device may comprise any PS/2 compatible apparatus, such as a wireless mouse, keyboard, or other peripheral. The device attribute may comprise a power source state, a signal quality state, or other attribute of the device. Preferably, the host initiates the process or reporting a device attribute by sending a predetermined sequence of standard PS/2 commands to the device. The device recognizes this predetermined sequence as a single instruction to begin reporting the device attribute. Returned in the encoded data packet, the predefined indicator may be provided in one or more parameters that are allocated for movement data and/or other data of the device. Although the predefined indicator may comprise valid device data, the device data preferably corresponds to a combination of device movement data and device status data that has a very low probability of occurring. The device attribute value may be encoded in another parameter that is allocated for movement of a component on the device, such as in a Z movement parameter for a scroll wheel. After decoding the device attribute value from the encoded PS/2 data packet, the device attribute value may be compared to a previously stored valued. If different, a message may be displayed to a user, a separate application program may be launched, or other action taken.
Another aspect of the invention includes a machine readable medium storing machine instructions for carrying out the steps introduced above and described in further detail below.